home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / latex209 / contrib / misc / endnote.sty < prev    next >
Text File  |  1992-03-19  |  1KB  |  35 lines

  1. % Use \endnote{1}{text}. At the end of your document, type
  2. % \producenotes to actually flush all end notes to be printed.
  3. %
  4. % macros for making endnotes instead of footnotes
  5. % We make @ signs act like letters, temporarily, to avoid conflict
  6. % between user names and internal control sequences of plain format.
  7. \catcode`@=11
  8. \newbox\endnotebox
  9.  
  10. \def\setendnotefont#1{\gdef\endnotefont{#1}}
  11. \setendnotefont{\normalsize\rm}
  12. \@definecounter{endnotei}
  13. \def\theendnotei{\arabic{endnotei}}
  14. \def\labelendnotei{(\theendnotei)}
  15.  
  16. \def\endnote#1{\let\@sf\empty
  17.   \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
  18.   \stepcounter{endnotei} $^{\theendnotei}$\@sf% \vendnote
  19.    {\global\setbox\endnotebox=
  20.    \vbox{\parindent=0pt\endnotefont\unvbox\endnotebox\bgroup \theendnotei.\
  21.    #1\@endnote}}}
  22.  
  23. \def\no@te{\ifcat\bgroup\noexpand\next \let\next\n@@te
  24.   \else\let\next\n@t\fi }%\next}
  25.  
  26. \def\n@@te{\bgroup\aftergroup\@endnote\let\next}
  27.  
  28. \def\n@t#1{#1\@endnote}
  29.  
  30. \def\@endnote{\strut\unskip\hfil \penalty -\@M\relax \egroup} %
  31.  
  32. \def\producenotes{%
  33. \ifvoid\endnotebox\else\medskip\unvbox\endnotebox\par\fi}
  34. \catcode`@=12 % at signs are no longer letters
  35.